package data;

import java.util.Date;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class Agency extends AbstractData {
private long id = -1;
private long hotelId;
private long displayId;
private String agency;
private String organization;
//main office
private String mainaddress;
private String maincountry;
private String mainstate;
private String maincity;
private String mainzipcode;
//contact person detail
private String salutationperson;
private String firstnameperson;
private String lastnameperson;
private String designationperson;
private String phoneofficeperson;
private String extendperson;
private String officefaxperson;
private String emailperson;
private String mobileperson;
private String genderperson;
private Date dobperson;
private String websiteperson;
//billing address
private String billtitle;
private String billaddress;
private String billcountry;
private String billstate;
private String billcity;
private String billzipcode;
//billing contact
private String contactsalutaion;
private String contactfirstname;
private String contactlastname;
private String contactdesignation;
private String contactofficephone;
private String contactextend;
private String contactofficefax;
private String contactemail;
private String contactmobile;
private String contactgender;
private Date contactdob;
private String contactwebsite;
//
private String listcreditString;
private String creditlimit;
private String discount;
private String paymentterms;
private String listValidity;
private String poscommission;
private boolean status;
private boolean avaliable;
private boolean corporate;

public boolean isCorporate() {
	return corporate;
}

public void setCorporate(boolean corporate) {
	this.corporate = corporate;
}

public Agency(){
	
}

public Agency(long id)
{
	this.id = id;
}

public long getId() {
	return id;
}
public void setId(long id) {
	this.id = id;
}
public long getHotelId() {
	return hotelId;
}
public void setHotelId(long hotelId) {
	this.hotelId = hotelId;
}
public String getAgency() {
	return agency;
}
public void setAgency(String agency) {
	this.agency = agency;
}
public String getOrganization() {
	return organization;
}
public void setOrganization(String organization) {
	this.organization = organization;
}

public long getDisplayId() {
	return displayId;
}

public void setDisplayId(long displayId) {
	this.displayId = displayId;
}

public String getMainaddress() {
	return mainaddress;
}

public void setMainaddress(String mainaddress) {
	this.mainaddress = mainaddress;
}

public String getMaincountry() {
	return maincountry;
}

public void setMaincountry(String maincountry) {
	this.maincountry = maincountry;
}

public String getMainstate() {
	return mainstate;
}

public void setMainstate(String mainstate) {
	this.mainstate = mainstate;
}

public String getMaincity() {
	return maincity;
}

public void setMaincity(String maincity) {
	this.maincity = maincity;
}

public String getMainzipcode() {
	return mainzipcode;
}

public void setMainzipcode(String mainzipcode) {
	this.mainzipcode = mainzipcode;
}

public String getSalutationperson() {
	return salutationperson;
}

public void setSalutationperson(String salutationperson) {
	this.salutationperson = salutationperson;
}

public String getFirstnameperson() {
	return firstnameperson;
}

public void setFirstnameperson(String firstnameperson) {
	this.firstnameperson = firstnameperson;
}

public String getLastnameperson() {
	return lastnameperson;
}

public void setLastnameperson(String lastnameperson) {
	this.lastnameperson = lastnameperson;
}

public String getDesignationperson() {
	return designationperson;
}

public void setDesignationperson(String designationperson) {
	this.designationperson = designationperson;
}

public String getPhoneofficeperson() {
	return phoneofficeperson;
}

public void setPhoneofficeperson(String phoneofficeperson) {
	this.phoneofficeperson = phoneofficeperson;
}

public String getExtendperson() {
	return extendperson;
}

public void setExtendperson(String extendperson) {
	this.extendperson = extendperson;
}

public String getOfficefaxperson() {
	return officefaxperson;
}

public void setOfficefaxperson(String officefaxperson) {
	this.officefaxperson = officefaxperson;
}

public String getEmailperson() {
	return emailperson;
}

public void setEmailperson(String emailperson) {
	this.emailperson = emailperson;
}

public String getMobileperson() {
	return mobileperson;
}

public void setMobileperson(String mobileperson) {
	this.mobileperson = mobileperson;
}

public String getGenderperson() {
	return genderperson;
}

public void setGenderperson(String genderperson) {
	this.genderperson = genderperson;
}

public Date getDobperson() {
	return dobperson;
}

public void setDobperson(Date dobperson) {
	this.dobperson = dobperson;
}

public String getWebsiteperson() {
	return websiteperson;
}

public void setWebsiteperson(String websiteperson) {
	this.websiteperson = websiteperson;
}

public String getBilltitle() {
	return billtitle;
}

public void setBilltitle(String billtitle) {
	this.billtitle = billtitle;
}



public String getBilladdress() {
	return billaddress;
}

public void setBilladdress(String billaddress) {
	this.billaddress = billaddress;
}

public String getBillcountry() {
	return billcountry;
}

public void setBillcountry(String billcountry) {
	this.billcountry = billcountry;
}

public String getBillstate() {
	return billstate;
}

public void setBillstate(String billstate) {
	this.billstate = billstate;
}

public String getBillcity() {
	return billcity;
}

public void setBillcity(String billcity) {
	this.billcity = billcity;
}

public String getBillzipcode() {
	return billzipcode;
}

public void setBillzipcode(String billzipcode) {
	this.billzipcode = billzipcode;
}

public String getContactsalutaion() {
	return contactsalutaion;
}

public void setContactsalutaion(String contactsalutaion) {
	this.contactsalutaion = contactsalutaion;
}

public String getContactfirstname() {
	return contactfirstname;
}

public void setContactfirstname(String contactfirstname) {
	this.contactfirstname = contactfirstname;
}

public String getContactlastname() {
	return contactlastname;
}

public void setContactlastname(String contactlastname) {
	this.contactlastname = contactlastname;
}

public String getContactdesignation() {
	return contactdesignation;
}

public void setContactdesignation(String contactdesignation) {
	this.contactdesignation = contactdesignation;
}

public String getContactofficephone() {
	return contactofficephone;
}

public void setContactofficephone(String contactofficephone) {
	this.contactofficephone = contactofficephone;
}

public String getContactextend() {
	return contactextend;
}

public void setContactextend(String contactextend) {
	this.contactextend = contactextend;
}

public String getContactofficefax() {
	return contactofficefax;
}

public void setContactofficefax(String contactofficefax) {
	this.contactofficefax = contactofficefax;
}

public String getContactemail() {
	return contactemail;
}

public void setContactemail(String contactemail) {
	this.contactemail = contactemail;
}

public String getContactmobile() {
	return contactmobile;
}

public void setContactmobile(String contactmobile) {
	this.contactmobile = contactmobile;
}
public String getContactgender() {
	return contactgender;
}

public void setContactgender(String contactgender) {
	this.contactgender = contactgender;
}

public Date getContactdob() {
	return contactdob;
}

public void setContactdob(Date contactdob) {
	this.contactdob = contactdob;
}

public String getContactwebsite() {
	return contactwebsite;
}

public void setContactwebsite(String contactwebsite) {
	this.contactwebsite = contactwebsite;
}

public String getListcreditString() {
	return listcreditString;
}

public void setListcreditString(String listcreditString) {
	this.listcreditString = listcreditString;
}

public String getListValidity() {
	return listValidity;
}

public void setListValidity(String listValidity) {
	this.listValidity = listValidity;
}

public String getPoscommission() {
	return poscommission;
}

public void setPoscommission(String poscommission) {
	this.poscommission = poscommission;
}

public boolean isStatus() {
	return status;
}
public void setStatus(boolean status) {
	this.status = status;
}
public boolean isAvaliable() {
	return avaliable;
}
public void setAvaliable(boolean avaliable) {
	this.avaliable = avaliable;
}

public String getCreditlimit() {
	return creditlimit;
}

public void setCreditlimit(String creditlimit) {
	this.creditlimit = creditlimit;
}

public String getPaymentterms() {
	return paymentterms;
}

public void setPaymentterms(String paymentterms) {
	this.paymentterms = paymentterms;
}

public String getDiscount() {
	return discount;
}

public void setDiscount(String discount) {
	this.discount = discount;
}
public Entity getEntity()
{
	Entity item;
	if(this.key == null)
		item = new Entity(EntityName.Agency);
	else
		item = new Entity(this.key);
	
	item.setProperty("hotelId", this.hotelId);
	item.setProperty("agency", this.agency);
	item.setProperty("organization", this.organization);
	item.setProperty("status",this.status);
	item.setProperty("avaliable",this.avaliable);
	item.setProperty("corporate",this.corporate);
	item.setProperty("displayId",this.displayId);
	item.setProperty("mainaddress",this.mainaddress);
	item.setProperty("maincountry",this.maincountry);
	item.setProperty("mainstate",this.mainstate);
	item.setProperty("maincity",this.maincity);
	item.setProperty("mainzipcode",this.mainzipcode);
	item.setProperty("salutationperson",this.salutationperson);
	item.setProperty("firstnameperson",this.firstnameperson);
	item.setProperty("lastnameperson",this.lastnameperson);
	item.setProperty("designationperson",this.designationperson);
	item.setProperty("phoneofficeperson",this.phoneofficeperson);
	item.setProperty("extendperson",this.extendperson);
	item.setProperty("officefaxperson",this.officefaxperson);
	item.setProperty("emailperson",this.emailperson);
	item.setProperty("mobileperson",this.mobileperson);
	item.setProperty("genderperson",this.genderperson);
	item.setProperty("dobperson",this.dobperson);
	item.setProperty("websiteperson",this.websiteperson);
	item.setProperty("billtitle",this.billtitle);
	item.setProperty("billaddress",this.billaddress);
	item.setProperty("billcountry",this.billcountry);
	item.setProperty("billstate",this.billstate);
	item.setProperty("billcity",this.billcity);
	item.setProperty("billzipcode",this.billzipcode);
	item.setProperty("contactsalutaion",this.contactsalutaion);
	item.setProperty("contactfirstname",this.contactfirstname);
	item.setProperty("contactlastname",this.contactlastname);
	item.setProperty("contactdesignation",this.contactdesignation);
	item.setProperty("contactofficephone",this.contactofficephone);
	item.setProperty("contactextend",this.contactextend);
	item.setProperty("contactofficefax",this.contactofficefax);
	item.setProperty("contactemail",this.contactemail);
	item.setProperty("contactmobile",this.contactmobile);
	item.setProperty("contactgender",this.contactgender);
	item.setProperty("contactdob",this.contactdob);
	item.setProperty("contactwebsite",this.contactwebsite);
	item.setProperty("creditlimit",this.creditlimit);
	item.setProperty("paymentterms",this.paymentterms);
	item.setProperty("listValidity",this.listValidity);
	item.setProperty("listcreditString",this.listcreditString);
	item.setProperty("poscommission",this.poscommission);
	item.setProperty("discount",this.discount);
	return item;
}
@Override
public void setEntity(Entity entity) {
	
	this.id = entity.getKey().getId();
	this.hotelId = (Long) entity.getProperty("hotelId");
	this.agency = (String) entity.getProperty("agency");
	this.organization = (String) entity.getProperty("organization");
	this.status = (Boolean) entity.getProperty("status");
	this.avaliable =(Boolean) entity.getProperty("avaliable");
	this.corporate = (Boolean) entity.getProperty("corporate");
	this.displayId = (Long) entity.getProperty("displayId");
	this.mainaddress = (String) entity.getProperty("mainaddress");
	this.maincountry = (String) entity.getProperty("maincountry");
	this.mainstate = (String) entity.getProperty("mainstate");
	this.maincity = (String) entity.getProperty("maincity");
	this.mainzipcode = (String) entity.getProperty("mainzipcode");
	this.salutationperson = (String) entity.getProperty("salutationperson");
	this.firstnameperson = (String) entity.getProperty("firstnameperson");
	this.lastnameperson = (String) entity.getProperty("lastnameperson");
	this.designationperson = (String) entity.getProperty("designationperson");
	this.phoneofficeperson = (String) entity.getProperty("phoneofficeperson");
	this.extendperson = (String) entity.getProperty("extendperson");
	this.officefaxperson = (String) entity.getProperty("officefaxperson");
	this.emailperson = (String) entity.getProperty("emailperson");
	this.mobileperson = (String) entity.getProperty("mobileperson");
	this.genderperson = (String) entity.getProperty("genderperson");
	this.dobperson = (Date) entity.getProperty("dobperson");
	this.websiteperson = (String) entity.getProperty("websiteperson");
	this.billtitle = (String) entity.getProperty("billtitle");
	this.billaddress = (String) entity.getProperty("billaddress");
	this.billcountry = (String) entity.getProperty("billcountry");
	this.billstate = (String) entity.getProperty("billstate");
	this.billcity = (String) entity.getProperty("billcity");
	this.billzipcode = (String) entity.getProperty("billzipcode");
	this.contactsalutaion = (String) entity.getProperty("contactsalutaion");
	this.contactfirstname = (String) entity.getProperty("contactfirstname");
	this.contactlastname = (String) entity.getProperty("contactlastname");
	this.contactdesignation = (String) entity.getProperty("contactdesignation");
	this.contactofficephone = (String) entity.getProperty("contactofficephone");
	this.contactextend = (String) entity.getProperty("contactextend");
	this.contactofficefax = (String) entity.getProperty("contactofficefax");
	this.contactemail = (String) entity.getProperty("contactemail");
	this.contactmobile = (String) entity.getProperty("contactmobile");
	this.contactgender = (String) entity.getProperty("contactgender");
	this.contactdob = (Date) entity.getProperty("contactdob");
	this.contactwebsite = (String) entity.getProperty("contactwebsite");
	this.listcreditString = (String) entity.getProperty("listcreditString");
	this.creditlimit = (String) entity.getProperty("creditlimit");
	this.paymentterms = (String) entity.getProperty("paymentterms");
	this.listValidity = (String) entity.getProperty("listValidity");
	this.poscommission = (String) entity.getProperty("poscommission");
	this.discount = (String) entity.getProperty("discount");
	this.key = entity.getKey();
}

public void LoadData() {
	if (this.id > -1) {
		Entity entity = LoadData(EntityName.Agency, this.id);
		setEntity(entity);
	}
}

}